#pragma once
#include "IComponent.h"

namespace ZeEngine
{
    class TransformComponent : public IComponent
    {
        friend class TransformSystem;

    public:
        TransformComponent(const Vector2D<float>& position, float rotation = 0);
        TransformComponent();

        virtual ~TransformComponent();

        void SetActive(bool fActive) override {}
        void Reset() override {}

        const Vector2D<float> GetInterpolatedPosition(float interpolation) const;
        const float GetInterpolatedRotation(float interpolation) const;

		void SetPosition(const Vector2D<float>& position);
		const Vector2D<float>& GetPosition() const { return m_position; }

        void SetRotation(float rotation);
        float GetRotation() { return m_rotation; }

        void SetScale(const Vector2D<float>& scale);
        const Vector2D<float>& GetScale() const { return m_scale; }

	private:
        float           m_rotation;
        Vector2D<float> m_scale;
		Vector2D<float> m_position;

        Vector2D<float> m_previousPosition;
        float           m_previousRotation;
        Vector2D<float> m_previousScale;

	#define ICOMPONENT_I
	#include ICOMPONENT_H
    };
}
